﻿namespace Example.Creational
{
    using Example.Creational.Multiton;

    using Xunit;

    /// <summary>
    /// Ensure a class has only named instances, and provide global point of access to them.
    /// </summary>
    public sealed class MultitonFacts
    {
        [Fact]
        public void rolodex_card()
        {
            const string key = "John Doe";

            var expected = Rolodex.Open(key);
            expected.Information = "john.doe@example.com";

            var actual = Rolodex.Open(key);

            Assert.Same(expected, actual);
        }
    }
}